import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:'/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children:[
      {
        path:'/home',
        redirect:'/home/classify'
      },
      {
        path:'classify',
        component: () => import(/* webpackChunkName: "classify" */ '../views/home/Classify.vue')
      },
      {
        path:'car',
        component: () => import(/* webpackChunkName: "car" */ '../views/home/Car.vue')
      },
    ]
  },
  {
    path: '/about',
    name: 'About',
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
